package pl.prv.polanie.client.service;

import pl.prv.polanie.client.dto.AcademicTitleDTO;
import pl.prv.polanie.client.dto.CSAcademicTitleDTO;
import pl.prv.polanie.client.dto.CSBuildingDTO;
import pl.prv.polanie.client.dto.CSCalendarDayDTO;
import pl.prv.polanie.client.dto.CSDeclarationDTO;
import pl.prv.polanie.client.dto.CSGroupDTO;
import pl.prv.polanie.client.dto.CSLecturerDTO;
import pl.prv.polanie.client.dto.CSPreferenceDTO;
import pl.prv.polanie.client.dto.CSPreferenceTypeDTO;
import pl.prv.polanie.client.dto.CSRoomDTO;
import pl.prv.polanie.client.dto.CSRoomTypeDTO;
import pl.prv.polanie.client.dto.CSSemesterDTO;
import pl.prv.polanie.client.dto.CSSemesterTypeDTO;
import pl.prv.polanie.client.dto.CSSemestersYearGroupsDTO;
import pl.prv.polanie.client.dto.CSStudiesTypeDTO;
import pl.prv.polanie.client.dto.CSSubgroupDTO;
import pl.prv.polanie.client.dto.CSSubgroupTypeDTO;
import pl.prv.polanie.client.dto.CSSubjectDTO;
import pl.prv.polanie.client.dto.CSSubjectEventDTO;
import pl.prv.polanie.client.dto.CSSubjectNameDTO;
import pl.prv.polanie.client.dto.CSSubjectTypeDTO;
import pl.prv.polanie.client.dto.CSYearGroupNameDTO;
import pl.prv.polanie.client.dto.TestDTO;
import pl.prv.polanie.client.dto.transport.CSTDuplicatingSemesterReportDTO;

import com.google.gwt.user.client.rpc.RemoteService;

public interface PlannerService extends RemoteService {

	
	
	//zwraca subjectEvents dla grupy
	public CSSubjectEventDTO[] getSubjectEventsByGroupID(Long groupID);
	public CSSubjectEventDTO[] getCSSubjectEventsByGroupID(Long groupID);

	//zwraca subjectEvents dla sali i lecturera
	public CSSubjectEventDTO[] getCSSubjectEventsByRoomID(Long roomID, Long semesterID);
	public CSSubjectEventDTO[] getCSSubjectEventsByLecturerID(Long lecturerID, Long semesterID);

	public CSSubjectEventDTO[] getCSSubjectEventsBySemesterID(Long semesterID);

	
	//zwraca lecture preferences dla lecturera w podanym semestrze
//	public PreferenceDTO[] getLecturerPreferencesBySemesterGroupID(Long lecturerID, Long semesterID);
//	public CSPreferenceDTO[] getCSLecturerPreferencesBySemesterGroupID(Long lecturerID, Long semesterID);
	
	public CSPreferenceDTO[] getCSPreferencesBySemesterID(Long semesterID);	
	
	//duplikuje semestr
	public CSTDuplicatingSemesterReportDTO createSemesterBasingOnExistingOne(CSSemesterDTO newSemester, CSSemesterDTO existingS);
	
	
	//zwraca obiekty skojarzone z danym semestrem
	public CSGroupDTO[] getGroupsBySemesterID(Long semesterID);
	public CSDeclarationDTO[] getCSDeclarationsBySemesterID(Long semesterID);
	public CSSubgroupDTO[] getSubgroupsBySemesterID(Long semesterID);
	public CSSemestersYearGroupsDTO[] getCSSemestersYearGroupsBySemesterID(Long semesterID);
	public CSCalendarDayDTO[] getCSCalendarDaysBySemesterID(Long semesterID);
	
	
	public long saveCSSubjectEvent(CSSubjectEventDTO subjectEvent);
	public long[] saveCSSubjectEvents(CSSubjectEventDTO[] subjectEvent);
	public boolean removeCSSubjectEvent(CSSubjectEventDTO subjectEvent);
	
	public long saveCSDeclaration(CSDeclarationDTO declaration);
	public boolean removeCSDeclaration(CSDeclarationDTO declaration);

	
	
	public long saveCSLecturer(CSLecturerDTO lecturer);
	public boolean removeCSLecturer(CSLecturerDTO lecturer);
	
	public long saveCSSemester(CSSemesterDTO semester);
	public boolean removeCSSemester(CSSemesterDTO semester);

	public long saveCSSubgroup(CSSubgroupDTO subgroup);
	public boolean removeCSSubgroup(CSSubgroupDTO subgroup);

	public long saveCSGroup(CSGroupDTO group);
	public boolean removeCSGroup(CSGroupDTO group);	

	
	
	public long saveCSAcademicTitle(CSAcademicTitleDTO academicTitle);
	public boolean removeCSAcademicTitle(CSAcademicTitleDTO academicTitle);

	public long saveCSCalendarDay(CSCalendarDayDTO calendarDay);
	public boolean removeCSCalendarDay(CSCalendarDayDTO calendarDay);

	public long saveCSSubjectName(CSSubjectNameDTO subjectName);
	public boolean removeCSSubjectName(CSSubjectNameDTO subjectName);
	
	public long saveCSSubject(CSSubjectDTO subject);
	public boolean removeCSSubject(CSSubjectDTO subject);
	
	public long saveCSSubjectType(CSSubjectTypeDTO subjectType);
	public boolean removeCSSubjectType(CSSubjectTypeDTO subjectType);

	public long saveCSSubgroupType(CSSubgroupTypeDTO subjectType);
	public boolean removeCSSubgroupType(CSSubgroupTypeDTO subjectType);

	public long saveCSBuilding(CSBuildingDTO building);
	public boolean removeCSBuilding(CSBuildingDTO building);

	public long saveCSRoomType(CSRoomTypeDTO roomType);
	public boolean removeCSRoomType(CSRoomTypeDTO roomType);	

	public long saveCSRoom(CSRoomDTO room);
	public boolean removeCSRoom(CSRoomDTO room);	
	
	public long saveCSYearGroupName(CSYearGroupNameDTO ygn);
	public boolean removeCSYearGroupName(CSYearGroupNameDTO ygn);	
	
	public long saveCSSemestersYearGroups(CSSemestersYearGroupsDTO syg);
	public boolean removeCSSemestersYearGroups(CSSemestersYearGroupsDTO syg);
	
	public long saveCSPreferenceType(CSPreferenceTypeDTO preferenceType);
	public boolean removeCSPreferenceType(CSPreferenceTypeDTO preferenceType);
	
//	public void saveSubjectEvent(SubjectEventDTO subjectEvent);
	
	
	
	//zwraca id zapisanego obiektu preference
	public long savePreference(CSPreferenceDTO csPreferenceDTO);
	public void removePreference(CSPreferenceDTO csPreferenceDTO);
	
	/**
	 * Ponizsze metody zwracaja wszystkie obiekty z bazy.
	 */
	public CSSubjectEventDTO[] getSubjectEvents();
	public CSDeclarationDTO[] getDeclarations();

	public CSSubgroupDTO[] getSubgroups();
	public CSGroupDTO[] getGroups();
	public CSSemestersYearGroupsDTO[] getSemestersYearGroups();
	public CSYearGroupNameDTO[] getYearGroupNames();
	
	
	public CSSemesterDTO[] getCSSemesters();
	public CSSemesterTypeDTO[] getSemesterTypes();
	public CSStudiesTypeDTO[] getStudiesTypes();
	public CSSubgroupTypeDTO[] getSubgroupTypes();
	
	public CSSubjectDTO[] getSubjects();
	public CSSubjectNameDTO[] getSubjectNames();
	public CSSubjectTypeDTO[] getSubjectTypes();
	
	public CSRoomDTO[] getRooms();
	public CSRoomTypeDTO[] getRoomTypes();
	public CSLecturerDTO[] getLecturers();
	public CSBuildingDTO[] getBuildings();
	public AcademicTitleDTO getAcademicTitle();
	public CSAcademicTitleDTO[] getAcademicTitles();
	public CSPreferenceTypeDTO[] getPreferenceTypes();
//	public PreferenceDTO[] getPreferences();
	
	
	
	public Boolean signInAdministrator(String login, String password);
	

	
	public TestDTO getTestDTO();

}
